package com.twu.biblioteca;

public class Controller {

    private UserInterface userInterface;
    private Database database;
    private State currentState;

    public Controller(UserInterface userInterface, Database database) {
        this.userInterface = userInterface;
        this.database = database;
    }

    public void run() {

        LoginState.setCurrentUser(null);
        currentState = new InitialState();
        while (currentState != null) currentState = currentState.executeStateBehaviour(userInterface, database);

    }

}
